<?php
set_include_path("../include");
require_once 'util/helperFunctions.php';
require_once 'model/Registration.php';
require_once 'model/Event.php';


$regid = $_POST["regid"];
$eventid = $_POST["eventid"];

if (isset($regid)) {
	$registration = Registration::loadRegistration((integer)$regid);
	$registration->setPayed(!$registration->isPayed());
	$registration->saveIsPayed();
	header("Location: ../admin.php?evt=".$eventid."&p=reg");
} else {
	header("Location: ../admin.php?evt=".$eventid."&p=reg");
}
?>